package com.example.amoocspringboot.controller;

import com.example.amoocspringboot.ResponseResult;
import com.example.amoocspringboot.entity.User;
import com.example.amoocspringboot.service.LoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
public class LoginController {
    @Autowired
    private LoginService loginService;

    @PostMapping("/api/user/login")
    public ResponseResult<Map<String, Object>> login(@RequestBody User user) {
        return loginService.login(user);
    }
}
